
package casino;

import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.io.File;

public abstract class MenuItem extends Rectangle{
	public final static long serialVersionUID = 1L;
	public Menu host;
	public String info;
	public Font font;
	
	public MenuItem(){}
	
	public MenuItem(Menu m, int x, int y, int w, int h, String content, int fontsize){
		host = m;
		this.x = x;
		this.y = y;
		width = w;
		height = h;
		try{
			font = Font.createFont(Font.TRUETYPE_FONT, new File("images/space.ttf"));
		}catch (Exception e){}
		font = font.deriveFont(0, fontsize);
		info = content;
	}
	
	public MenuItem(Menu m, int x, int y, int w, int h, String content, int fontsize, String f){
		host = m;
		this.x = x;
		this.y = y;
		width = w;
		height = h;
		try{
			font = Font.createFont(Font.TRUETYPE_FONT, new File(f));
		}catch (Exception e){}
		font = font.deriveFont(0, fontsize);
		info = content;
	}
	
	public void update(){}
	
	public void onHover(int x, int y){}
	
	public void offHover(int x, int y){}
	
	public void clicked(MouseEvent e){}
	
	public void released(MouseEvent e){}
	
	protected abstract void draw(Graphics2D g);
}
